<template>
    <div class="tourist">
        <div class="top">
            <p class="title">实时游客统计</p>
            <p class="bg"></p>
            <p class="right">可预约总量：<span>999</span>人</p>
        </div>
        <div class="number">
            <span v-for="item in peple" :key="item">{{ item }}</span>
        </div>
        <!-- echart图表 -->
        <div class="charts" ref="charts">
        </div>
    </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
const peple = ref('216908人');
import * as echarts from 'echarts'
import 'echarts-liquidfill'
// 获取节点
const charts = ref();
onMounted(() => {
    // 获取echarts的实例
    const myCharts = echarts.init(charts.value)
    // 设置实例的配置项
    myCharts.setOption({
        // 标题组件的设置
        title: {
            text: '水球图'
        },
        // x轴的设置
        // xAxis: {},
        // y轴的设置
        // yAxis: {},
        // 系列：决定要展示什么样的图表
        series: {
            type: 'liquidFill',
            data: [0.6, 0.2, 0.4], //水球图展示的数据
            waveAnimation: true,
            radius: '95%',  
        },
        // 布局组件
        grid: {
            left: 0,
            top: 0,
            bottom: 0,
            right: 0,
        },



    })
})

</script>

<style lang="scss" scoped>
.tourist {
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;

    .top {
        margin-left: 20px;

        .title {
            color: #fff;
            font-size: 20px;
        }

        .bg {
            width: 68px;
            height: 7px;
            background-size: 100% 100%;
            margin: 10px 0;
            background: url(../../images/dataScreen-title.png) no-repeat;
        }

        .right {
            float: right;
            margin-right: 10px;
            color: #fff;
            font-size: 20px;

            span {
                font-style: italic;
                color: yellowgreen;
            }
        }
    }

    .number {
        display: flex;
        margin-top: 50px;
        padding: 20px;

        span {
            flex: 1;
            height: 40px;
            text-align: center;
            line-height: 40px;
            background: url(../../images/total.png) no-repeat;
            margin-right: 3px;
            background-size: 100% 100%;
            color: #fff;
        }
    }
}

.charts {
    width: 100%;
    height: 265px;
}
</style>